3.84 \(\int \frac{(2+x) (d+e x+f x^2+g x^3+h x^4+i x^5)}{4-5 x^2+x^4} \, dx\)

Optimal. Leaf size=96 \[ -\frac{1}{2} \log (1-x) (d+e+f+g+h+i)+\frac{1}{3} \log (2-x) (d+2 e+4 f+8 g+16 h+32 i)+\frac{1}{6} \log (x+1) (d-e+f-g+h-i)+x (g+2 h+5 i)+\frac{1}{2} x^2 (h+2 i)+\frac{i x^3}{3} \]

[Out]

(g + 2*h + 5*i)*x + ((h + 2*i)*x^2)/2 + (i*x^3)/3 - ((d + e + f + g + h + i)*Log[1 - x])/2 + ((d + 2*e + 4*f +
 8*g + 16*h + 32*i)*Log[2 - x])/3 + ((d - e + f - g + h - i)*Log[1 + x])/6

________________________________________________________________________________________

Rubi [A]  time = 0.136906, antiderivative size = 96, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.049, Rules used = {1586, 2074} \[ -\frac{1}{2} \log (1-x) (d+e+f+g+h+i)+\frac{1}{3} \log (2-x) (d+2 e+4 f+8 g+16 h+32 i)+\frac{1}{6} \log (x+1) (d-e+f-g+h-i)+x (g+2 h+5 i)+\frac{1}{2} x^2 (h+2 i)+\frac{i x^3}{3} \]

Antiderivative was successfully verified.

[In]

Int[((2 + x)*(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5))/(4 - 5*x^2 + x^4),x]

[Out]

(g + 2*h + 5*i)*x + ((h + 2*i)*x^2)/2 + (i*x^3)/3 - ((d + e + f + g + h + i)*Log[1 - x])/2 + ((d + 2*e + 4*f +
 8*g + 16*h + 32*i)*Log[2 - x])/3 + ((d - e + f - g + h - i)*Log[1 + x])/6

Rule 1586

Int[(u_.)*(Px_)^(p_.)*(Qx_)^(q_.), x_Symbol] :> Int[u*PolynomialQuotient[Px, Qx, x]^p*Qx^(p + q), x] /; FreeQ[
q, x] && PolyQ[Px, x] && PolyQ[Qx, x] && EqQ[PolynomialRemainder[Px, Qx, x], 0] && IntegerQ[p] && LtQ[p*q, 0]

Rule 2074

Int[(P_)^(p_)*(Q_)^(q_.), x_Symbol] :> With[{PP = Factor[P]}, Int[ExpandIntegrand[PP^p*Q^q, x], x] /;  !SumQ[N
onfreeFactors[PP, x]]] /; FreeQ[q, x] && PolyQ[P, x] && PolyQ[Q, x] && IntegerQ[p] && NeQ[P, x]

Rubi steps

\begin{align*} \int \frac{(2+x) \left (d+e x+f x^2+g x^3+h x^4+84 x^5\right )}{4-5 x^2+x^4} \, dx &=\int \frac{d+e x+f x^2+g x^3+h x^4+84 x^5}{2-x-2 x^2+x^3} \, dx\\ &=\int \left (420 \left (1+\frac{1}{420} (g+2 h)\right )+\frac{2688+d+2 e+4 f+8 g+16 h}{3 (-2+x)}+\frac{-84-d-e-f-g-h}{2 (-1+x)}+(168+h) x+84 x^2+\frac{-84+d-e+f-g+h}{6 (1+x)}\right ) \, dx\\ &=(420+g+2 h) x+\frac{1}{2} (168+h) x^2+28 x^3-\frac{1}{2} (84+d+e+f+g+h) \log (1-x)+\frac{1}{3} (2688+d+2 e+4 f+8 g+16 h) \log (2-x)-\frac{1}{6} (84-d+e-f+g-h) \log (1+x)\\ \end{align*}

Mathematica [A]  time = 0.0492444, size = 91, normalized size = 0.95 \[ \frac{1}{6} \left (-3 \log (1-x) (d+e+f+g+h+i)+2 \log (2-x) (d+2 e+4 (f+2 g+4 h+8 i))+\log (x+1) (d-e+f-g+h-i)+6 x (g+2 h+5 i)+3 x^2 (h+2 i)+2 i x^3\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[((2 + x)*(d + e*x + f*x^2 + g*x^3 + h*x^4 + i*x^5))/(4 - 5*x^2 + x^4),x]

[Out]

(6*(g + 2*h + 5*i)*x + 3*(h + 2*i)*x^2 + 2*i*x^3 - 3*(d + e + f + g + h + i)*Log[1 - x] + 2*(d + 2*e + 4*(f +
2*g + 4*h + 8*i))*Log[2 - x] + (d - e + f - g + h - i)*Log[1 + x])/6

________________________________________________________________________________________

Maple [A]  time = 0.009, size = 156, normalized size = 1.6 \begin{align*}{\frac{i{x}^{3}}{3}}+{\frac{h{x}^{2}}{2}}+i{x}^{2}+gx+2\,hx+5\,ix+{\frac{\ln \left ( 1+x \right ) d}{6}}-{\frac{\ln \left ( 1+x \right ) e}{6}}+{\frac{\ln \left ( 1+x \right ) f}{6}}-{\frac{\ln \left ( 1+x \right ) g}{6}}+{\frac{\ln \left ( 1+x \right ) h}{6}}-{\frac{\ln \left ( 1+x \right ) i}{6}}+{\frac{\ln \left ( x-2 \right ) d}{3}}+{\frac{2\,\ln \left ( x-2 \right ) e}{3}}+{\frac{4\,\ln \left ( x-2 \right ) f}{3}}+{\frac{8\,\ln \left ( x-2 \right ) g}{3}}+{\frac{16\,\ln \left ( x-2 \right ) h}{3}}+{\frac{32\,\ln \left ( x-2 \right ) i}{3}}-{\frac{\ln \left ( x-1 \right ) d}{2}}-{\frac{\ln \left ( x-1 \right ) e}{2}}-{\frac{\ln \left ( x-1 \right ) f}{2}}-{\frac{\ln \left ( x-1 \right ) g}{2}}-{\frac{\ln \left ( x-1 \right ) h}{2}}-{\frac{\ln \left ( x-1 \right ) i}{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((2+x)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x)

[Out]

1/3*i*x^3+1/2*h*x^2+i*x^2+g*x+2*h*x+5*i*x+1/6*ln(1+x)*d-1/6*ln(1+x)*e+1/6*ln(1+x)*f-1/6*ln(1+x)*g+1/6*ln(1+x)*
h-1/6*ln(1+x)*i+1/3*ln(x-2)*d+2/3*ln(x-2)*e+4/3*ln(x-2)*f+8/3*ln(x-2)*g+16/3*ln(x-2)*h+32/3*ln(x-2)*i-1/2*ln(x
-1)*d-1/2*ln(x-1)*e-1/2*ln(x-1)*f-1/2*ln(x-1)*g-1/2*ln(x-1)*h-1/2*ln(x-1)*i

________________________________________________________________________________________

Maxima [A]  time = 0.978034, size = 111, normalized size = 1.16 \begin{align*} \frac{1}{3} \, i x^{3} + \frac{1}{2} \,{\left (h + 2 \, i\right )} x^{2} +{\left (g + 2 \, h + 5 \, i\right )} x + \frac{1}{6} \,{\left (d - e + f - g + h - i\right )} \log \left (x + 1\right ) - \frac{1}{2} \,{\left (d + e + f + g + h + i\right )} \log \left (x - 1\right ) + \frac{1}{3} \,{\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2+x)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="maxima")

[Out]

1/3*i*x^3 + 1/2*(h + 2*i)*x^2 + (g + 2*h + 5*i)*x + 1/6*(d - e + f - g + h - i)*log(x + 1) - 1/2*(d + e + f +
g + h + i)*log(x - 1) + 1/3*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(x - 2)

________________________________________________________________________________________

Fricas [A]  time = 2.15066, size = 251, normalized size = 2.61 \begin{align*} \frac{1}{3} \, i x^{3} + \frac{1}{2} \,{\left (h + 2 \, i\right )} x^{2} +{\left (g + 2 \, h + 5 \, i\right )} x + \frac{1}{6} \,{\left (d - e + f - g + h - i\right )} \log \left (x + 1\right ) - \frac{1}{2} \,{\left (d + e + f + g + h + i\right )} \log \left (x - 1\right ) + \frac{1}{3} \,{\left (d + 2 \, e + 4 \, f + 8 \, g + 16 \, h + 32 \, i\right )} \log \left (x - 2\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2+x)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="fricas")

[Out]

1/3*i*x^3 + 1/2*(h + 2*i)*x^2 + (g + 2*h + 5*i)*x + 1/6*(d - e + f - g + h - i)*log(x + 1) - 1/2*(d + e + f +
g + h + i)*log(x - 1) + 1/3*(d + 2*e + 4*f + 8*g + 16*h + 32*i)*log(x - 2)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2+x)*(i*x**5+h*x**4+g*x**3+f*x**2+e*x+d)/(x**4-5*x**2+4),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.09888, size = 122, normalized size = 1.27 \begin{align*} \frac{1}{3} \, i x^{3} + \frac{1}{2} \, h x^{2} + i x^{2} + g x + 2 \, h x + 5 \, i x + \frac{1}{6} \,{\left (d + f - g + h - i - e\right )} \log \left ({\left | x + 1 \right |}\right ) - \frac{1}{2} \,{\left (d + f + g + h + i + e\right )} \log \left ({\left | x - 1 \right |}\right ) + \frac{1}{3} \,{\left (d + 4 \, f + 8 \, g + 16 \, h + 32 \, i + 2 \, e\right )} \log \left ({\left | x - 2 \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((2+x)*(i*x^5+h*x^4+g*x^3+f*x^2+e*x+d)/(x^4-5*x^2+4),x, algorithm="giac")

[Out]

1/3*i*x^3 + 1/2*h*x^2 + i*x^2 + g*x + 2*h*x + 5*i*x + 1/6*(d + f - g + h - i - e)*log(abs(x + 1)) - 1/2*(d + f
 + g + h + i + e)*log(abs(x - 1)) + 1/3*(d + 4*f + 8*g + 16*h + 32*i + 2*e)*log(abs(x - 2))